VERSION 5.00
Begin VB.Form listabuscar 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Lista"
   ClientHeight    =   6075
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   11640
   BeginProperty Font 
      Name            =   "Verdana"
      Size            =   9.75
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6075
   ScaleWidth      =   11640
   ShowInTaskbar   =   0   'False
   Begin VB.PictureBox frm_2 
      BackColor       =   &H8000000E&
      Height          =   5895
      Left            =   0
      ScaleHeight     =   5835
      ScaleWidth      =   10275
      TabIndex        =   2
      Top             =   0
      Width           =   10335
      Begin VB.PictureBox frm_1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   5895
         Left            =   0
         ScaleHeight     =   5895
         ScaleWidth      =   10215
         TabIndex        =   3
         Top             =   0
         Width           =   10215
         Begin VB.CheckBox chk_especial 
            BackColor       =   &H00FFFFFF&
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   4
            Top             =   600
            Visible         =   0   'False
            Width           =   3615
         End
         Begin VB.Label lbl_lab 
            BackColor       =   &H8000000E&
            BackStyle       =   0  'Transparent
            BorderStyle     =   1  'Fixed Single
            Height          =   255
            Index           =   0
            Left            =   5520
            TabIndex        =   13
            Top             =   720
            Visible         =   0   'False
            Width           =   975
         End
         Begin VB.Label lbl_reg 
            BackColor       =   &H8000000E&
            BackStyle       =   0  'Transparent
            Height          =   255
            Index           =   0
            Left            =   3960
            TabIndex        =   12
            Top             =   600
            Visible         =   0   'False
            Width           =   3375
         End
         Begin VB.Label lbl_4 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Nro. Muestra"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5400
            TabIndex        =   11
            Top             =   120
            Visible         =   0   'False
            Width           =   1455
         End
         Begin VB.Label lbl_3 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Nro. Registro"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3960
            TabIndex        =   10
            Top             =   120
            Width           =   1455
         End
         Begin VB.Label lbl_1 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Nombre"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   9
            Top             =   120
            Width           =   1335
         End
         Begin VB.Label lbl_2 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Coordenadas"
            BeginProperty Font 
               Name            =   "Verdana"
               Size            =   9.75
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   7560
            TabIndex        =   8
            Top             =   120
            Width           =   1455
         End
         Begin VB.Label lbl_x 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Latitud  -"
            Height          =   255
            Left            =   7800
            TabIndex        =   7
            Top             =   360
            Width           =   975
         End
         Begin VB.Label lbl_y 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Longitud"
            Height          =   255
            Left            =   8880
            TabIndex        =   6
            Top             =   360
            Width           =   1095
         End
         Begin VB.Label lbl_coorde 
            BackColor       =   &H00FFFFFF&
            Height          =   255
            Index           =   0
            Left            =   7560
            TabIndex        =   5
            Top             =   600
            Visible         =   0   'False
            Width           =   2535
         End
      End
   End
   Begin VB.CommandButton cmdAcept 
      Caption         =   "Adicionar"
      Height          =   375
      Left            =   10560
      TabIndex        =   1
      Top             =   240
      Width           =   1095
   End
   Begin VB.VScrollBar vsb 
      Height          =   5895
      LargeChange     =   200
      Left            =   10320
      SmallChange     =   100
      TabIndex        =   0
      Top             =   0
      Width           =   255
   End
End
Attribute VB_Name = "listabuscar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Activate()
'Activar
nombreform = Me.Name
End Sub
Private Sub Form_Load()
Dim explode() As String, explode1() As String
Dim i As Long, j As Long, nombre As String, aux As String
Dim band As String, cod As String, latitud As String, longitud As String
Dim sql As String, aux2 As Long

i = 0: j = 0
explode = Split(cadParametros, "*")
For i = LBound(explode) To UBound(explode)

explode1 = Split(explode(i), ",")
cod = devolverCod(" cod_protocolo as cod", "protocolo", "nro_reg='" & explode1(1) & "'", 0)
sql = devolverCod(" cod_coordenadas as cod", "datos_muestra", "cod_protocolo=" & cod, 0)
If sql <> "" Then
latitud = devolverCod(" latitud as cod", "coordenadas", "cod_coordenadas=" & sql, 0)
longitud = devolverCod(" longitud as cod", "coordenadas", "cod_coordenadas=" & sql, 0)
Else
latitud = "": longitud = ""
End If
'mostrar datos
If (j = 0) Then
  chk_especial(j).Caption = explode1(0): chk_especial(j).Visible = True
  lbl_reg(j).Caption = explode1(1): lbl_reg(j).Visible = True
  lbl_lab(j).Caption = explode1(2): lbl_lab(j).Visible = False 'True
  lbl_coorde(j).Caption = latitud & "  " & longitud: lbl_coorde(j).Visible = True
Else
 Load chk_especial(j) 'Incrementa el numero de elementos que requiere
      chk_especial(j).Caption = explode1(0)
      chk_especial(j).Top = chk_especial(j - 1).Top + 270
      chk_especial(j).Visible = True
 Load lbl_reg(j)
    lbl_reg(j).Caption = explode1(1)
    lbl_reg(j).Top = lbl_reg(j - 1).Top + 270
    lbl_reg(j).Visible = True
    '-----
 Load lbl_lab(j)
    lbl_lab(j).Caption = explode1(2)
    lbl_lab(j).Top = lbl_lab(j - 1).Top + 270
    lbl_lab(j).Visible = False 'True
 Load lbl_coorde(j)
      lbl_coorde(j).Caption = latitud & "  " & longitud
      lbl_coorde(j).Top = lbl_coorde(j - 1).Top + 270
      lbl_coorde(j).Visible = True
    '---
End If
  
 j = j + 1
Next i
band = i 'numero de checkbox
'si es vacio enviar mensaje y cerrar form


bandProtocolo = i
 '/---- VSCROLL FORM
 ' establece el hook para interceptar la rueda del mouse
 Hook vsb
 'Inicializa los scrolbar (los posiciona y le da los valores max y Largchange )
 Call EstablecerScrollBar("listabuscar")
 vsb.Top = 0
 'vsb.LargeChange = 50
 'vsb.SmallChange = 25
vsb.LargeChange = 50
vsb.SmallChange = 150 '25
'el maximo del scroll
If j = 1 Then
vsb.max = 1
Else
 If chk_especial.Count <= 10 Then
 j = 1
 Else
 frm_2.Height = chk_especial(j - 1).Top + 150 '+ 300 'COLUMNAS
 j = frm_2.Height
 End If
vsb.max = j 'frm_2.Height '25970
End If

frm_2.BorderStyle = 0

End Sub

Private Sub vsb_Change()
 If vsb.Value = 0 Then
     frm_1.Move 0, 0
 Else
     frm_1.Top = -vsb.Value
 End If
End Sub
Private Sub cmdAcept_Click()
Dim i As Long, cad As String, j As Long, u As Long, band As Long
band = bandProtocolo
'**** capturar los checkbox seleccionados
For i = 0 To band - 1
   If chk_especial(i).Value = 1 Then
   'codigoEspecialFisi
    If (j = 0) Then
    cad = devolverCod(" cod_protocolo as cod", "protocolo", "nro_reg='" & lbl_reg(i).Caption & "'", 0)
    'cad = lbl_reg(i).Caption:
    j = j + 1
    Else
     cad = cad + "*" + devolverCod(" cod_protocolo as cod", "protocolo", "nro_reg='" & lbl_reg(i).Caption & "'", 0)
     'lbl_reg(i).Caption
    End If
    u = 1
   'Else
   'u = 0
   End If
Next i
cadParametros = cad

If u = 1 Then 'si selecciono uno por lo menos
tickel1.Show
Unload Me
End If

End Sub
